﻿/**
 * Copyright (c) 2008 michiyasu wada
 * http://www.seyself.com/
 * 
 * Distributed under The MIT License.
 * [http://www.opensource.org/licenses/mit-license.php]
 */

import flash.events.EventDispatcher;
import flash.events.Event;

class com.seyself.events.EnterFrameBeacon extends EventDispatcher
{
    
    private static var initialized:Boolean = false;
    
    public function EnterFrameBeacon()
    {
        _init();
    }
    
    private function _init():Void
    {
        if ( !initialized ) {
            initialized = true;
            var loc:EnterFrameBeacon = this;
            var container:MovieClip = _root.createEmptyMovieClip("__EnterFrameOperator__", 35214 );
            container.onEnterFrame = function():Void
            {
                loc.dispatchEvent( new Event( "enterFrame" , false, false ) );
            }
        }
    }
    
    public function toString():String
    {
        return "[object EnterFrameBeacon]";
    }
    
}
